package com.atguigu.gmall.product.service.impl;

import com.atguigu.gmall.product.model.BaseTrademark;
import com.atguigu.gmall.product.mapper.BaseTrademarkMapper;
import com.atguigu.gmall.product.service.BaseTrademarkService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * 品牌表 业务实现类
 *
 * @author atguigu
 * @since 2023-06-08
 */
@Service
public class BaseTrademarkServiceImpl extends ServiceImpl<BaseTrademarkMapper, BaseTrademark> implements BaseTrademarkService {
    /**
     * 品牌管理分页列表
     * @param baseTrademarkPage
     * @return
     */
    @Override
    public Page<BaseTrademark> getBaseTrademark(Page<BaseTrademark> baseTrademarkPage) {
        LambdaQueryWrapper<BaseTrademark> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.orderByDesc(BaseTrademark::getUpdateTime);
        return baseMapper.selectPage(baseTrademarkPage,queryWrapper);
    }
}
